package cn.tedu.shoppingmall.mapper;

import cn.tedu.shoppingmall.vo.Class;
import cn.tedu.shoppingmall.vo.Commodity;
import cn.tedu.shoppingmall.vo.Report;
import org.apache.ibatis.annotations.*;
import org.mapstruct.Mapper;

import java.util.List;
//资讯数据库增删改查操作
@Mapper
public interface ReportMapper {
    //增加资讯信息
    @Insert("insert into report values(null,#{title},#{content},#{created},#{url},#{clsId})")
    void insert(Report report);


    //删除资讯信息
    @Delete("delete from report where id=#{id}")
    void delete(int id);


    //修改资讯信息
    @Update("update report set title=#{title},content=#{content},clsId=#{clsId},url=#{url} where id=#{id}")
    void update(Report report);


    //根据类别id查询所有资讯信息
    @Select("select * from report where clsid=#{clsid}")
    List<Report> selectByClsid(Integer clsid);
    //查询所有资讯信息
    @Select("select * from Report")
    List<Report> select();
    //查询资讯id查询单个资讯信息
    @Select("select * from report where id=#{id}")
    Report SelectById(int id);

}
